package recorder 
{
	import com.demonsters.debugger.MonsterDebugger;
	/**
	 * ...
	 * @author Gareth Williams
	 * collection that provides typing and instrospection for data used by recorder
	 */
	public dynamic class RecordData
	{
		public var timestep:Number;
		public function RecordData(forTimestep:Number)
		{
			timestep = forTimestep;
		}
		//uses introspection to encapsulate the application of it's properties to another object
		//visitor pattern, the user doesn't need to know what properties to access on the object to copy them to a new one
		public function applyTo(what:Object):Boolean
		{
			var appliedSuccessfully:Boolean = true;
			for (var property:String in this)
			{
				try
				{
					what[property] = this[property];
				}
				catch (error:ReferenceError)
				{
					MonsterDebugger.log("RecordData::applyTo - property", property, "doesn't exist on", what);
					appliedSuccessfully = false;
				}
			}
			return appliedSuccessfully;
		}
	}
}